﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Linq.Expressions;
using GrayParrot.Web.Controls;
using FimetContoDeposito.DAL;
using GrayParrot.Core.Filters;

namespace FimetContoDeposito.BLL.ResultSets
{
    public class GetDettaglioMovimentoCaricoClienteResultSet : ResultSet<FCD_GetDettaglioMovimentoCaricoClienteReturnModel>
	{
        public GetDettaglioMovimentoCaricoClienteResultSet(DTParameters param, IQueryable<FCD_GetDettaglioMovimentoCaricoClienteReturnModel> result)
            : base(param, result)
        {
        }

        public override Expression<Func<FCD_GetDettaglioMovimentoCaricoClienteReturnModel, bool>> ApplyGeneralFilter(string searchPattern)
        {
            var predicate = PredicateBuilder.False<FCD_GetDettaglioMovimentoCaricoClienteReturnModel>();

            //if (!string.IsNullOrWhiteSpace(searchPattern))
            //{
            //    predicate = predicate.Or(im => im.SportId != null && im.SportId.ToString().Contains(searchPattern));
            //    predicate = predicate.Or(im => im.OddsTypeId != null && im.OddsTypeId.ToString().Contains(searchPattern));
            //}

            return predicate;
        }

        public override Expression<Func<FCD_GetDettaglioMovimentoCaricoClienteReturnModel, bool>> ApplyGeneralColumnsFilter(List<string> columnSearch)
        {
            var predicate = PredicateBuilder.True<FCD_GetDettaglioMovimentoCaricoClienteReturnModel>();

            //int m_sport = int.Parse(columnSearch[ColumnIndex]);
            //int m_oddsType = int.Parse(columnSearch[ColumnIndex]);

            //if (m_sport != default(int))
            //{
            //    predicate = predicate.And(im => im.SportId == m_sport);
            //}

            //if (m_oddsType != default(int))
            //{
            //    predicate = predicate.And(im => im.OddsTypeId == m_oddsType);
            //}

            return predicate;
        }
	}
}
